<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="referrer" content="no-referrer" />
    <title>Home </title>
    <style>
        ul {
            list-style: none;
            display: flex;
            width: 1200px;
            margin: 20px auto;
            flex-wrap: wrap;
        }

        li {
            width: 25%;
            padding: 15px 25px;
            box-sizing: border-box;
        }

        a {
            text-decoration: none;
            color: #666;
            border: 1px solid #ddd;
            border-radius: 10px;
            margin: 10px;
            padding: 10px;
            width: 100%;
            display: block;
        }

        img {
            width: 100%;
            height: 220px;
        }
    </style>
</head>

<body>
    <div>
        <%- include('head',{title:'主页'}) %>
            <h2>
                Home - Home - 主页
            </h2>
            <div class="box">
                <ul class="list">
                    <% if(result.length>0){ %>
                        <% result.forEach((item,index)=>{ %>
                            <li class="item">
                                <a href="/detail?mid=<%- item.id %>">
                                    <img src="<%- item.images.large.replace(/img7/,'img3') %>" alt="">
                                    <h2>
                                        <%- item.title %>
                                    </h2>
                                    <p>年份：<%- item.year %>
                                    </p>
                                    <p>分类：<%- item.genres %>
                                    </p>
                                    <p>评分：<%- item.rating.average %>
                                    </p>
                                </a>
                            </li>
                            <% }) %>
                                <% }else{ %>
                                    <p style="text-align:center">暂无数据哦~</p>
                                    <% } %>
                </ul>
            </div>
            <%- include('foot')%>
    </div>
</body>

</html>